package com.luchao.back.service.impl;

import com.luchao.back.mapper.SizesMapper;
import com.luchao.back.pojo.Sizes;
import com.luchao.back.service.SizesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SizesServiceImpl implements SizesService {

    @Autowired
    private SizesMapper sizesMapper;

    @Override
    public List<Sizes> getSizesByPage(int pageNum, int pageSize) {
        return sizesMapper.getSizesByPage((pageNum - 1) * pageSize, pageSize);
    }

    @Override
    public int addSizes(Sizes sizes) {
        return sizesMapper.addSizes(sizes);
    }

    @Override
    public int editSizes(Sizes sizes) {
        return sizesMapper.editSizes(sizes);
    }

    @Override
    public long getSizesCount() {
        return sizesMapper.getSizesCount();
    }

    @Override
    public boolean batchChangeState(List<Sizes> list) {
        return sizesMapper.batchChangeState(list) > 0 ? true : false;
    }

    @Override
    public int checkSizes(float sizenum) {
        return sizesMapper.checkSizes(sizenum);
    }

    @Override
    public List<Sizes> getAllSizes() {
        return sizesMapper.getAllSizes();
    }

    @Override
    public List<Sizes> getAllSizesForView() {
        return sizesMapper.getAllSizesForView();
    }
}
